import request from '@/utils/request'

const base_url = 'admin/product/banner'

export default {

  // 分页条件查询Banner
  showBanner: () => {
    return request({
      url: 'api/index/banner',
      method: "GET"
    });
  },

  // 分页条件查询Banner
  page: data => {
    return request({
      url: `${base_url}/page`,
      method: "POST",
      data
    });
  },
  // 修改Banner状态
  updateStatus: data => {
    return request({
      url: `${base_url}/status`,
      method: "POST",
      data
    });
  },

  // Banner操作：有ID更新，无ID新增
  operate: data => {
    return request({
      url: `${base_url}/operate`,
      method: "POST",
      data
    });
  },

  // 删除Banner
  removeById: id => {
    return request({
      url: `${base_url}/remove/${id}`,
      method: "DELETE"
    });
  },

  // 批量删除Banner
  removeBatch: ids => {
    return request({
      url: `${base_url}/remove/batch`,
      method: "DELETE",
      data: ids
    });
  },

};




